package com.fqgj.sentry.controller.antiFraud;

import com.fqgj.sentry.biz.antiFraud.GpsDistributeBusiness;
import com.fqgj.sentry.common.annotations.VisitorAccessible;
import com.fqgj.sentry.common.response.ApiOutput;
import com.fqgj.sentry.controller.antiFraud.request.GpsDistributeQuery;
import com.fqgj.sentry.controller.antiFraud.response.gps.GpsInfoData;
import com.fqgj.sentry.controller.antiFraud.response.gps.GpsInfoDataUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/gps")
public class GpsDistributeController {

    @Autowired
    private GpsDistributeBusiness gpsDistributeBusiness;

    /**
     * 查询列表
     *
     * @param
     * @return
     */
    @VisitorAccessible
    @RequestMapping(value = "/distribute", method = RequestMethod.POST)
    public ApiOutput orderTree(@RequestBody GpsDistributeQuery gpsDistributeQuery) {
        GpsInfoData gpsInfoData = gpsDistributeBusiness.getGpsInfoData(gpsDistributeQuery);
        return new ApiOutput<>(gpsInfoData);
    }

    /**
     * 查询列表
     *
     * @param
     * @return
     */
    @RequestMapping(value = "/distribute/mock", method = RequestMethod.POST)
    public ApiOutput orderTreeMock(@RequestBody GpsDistributeQuery gpsDistributeQuery) {
        GpsInfoData gpsInfoData = GpsInfoDataUtil.getGpsInfoData();
        return new ApiOutput<>(gpsInfoData);
    }
}
